import { $http } from '@/utils';
import { $ResponseCode } from '@/utils/const/env';
export const UserFinanceAccount = {
    index() {
        return new Promise((resolve, reject) => {
            $http.get('UserFinanceAccount/index').then((res: any) => {
                if (res.code === $ResponseCode.SUCCESS) {
                    resolve(res.data);
                } else {
                    reject(res)
                }
            }).catch(() => {
                reject({ msg: '服务器繁忙，请稍后再试' })
            })
        })
    },
    save(data: any) {
        return new Promise((resolve, reject) => {
            $http.post('UserFinanceAccount/save', {
                data: data
            }).then((res: any) => {
                if (res.code === $ResponseCode.SUCCESS) {
                    resolve(res);
                } else {
                    reject(res)
                }
            }).catch(() => {
                reject({ msg: '服务器繁忙，请稍后再试' })
            })
        })
    },
}